import java.util.Scanner;

public class demo2 {
    public static char[] reverse(char[] ch, int x, int y){
        while(x < y){
            char tmp = ch[x];
            ch[x] = ch[y];
            ch[y] = tmp;
            y--;
            x++;
        }
        return ch;
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        char[] ch = s.toCharArray();
        reverse(ch,0, ch.length - 1);

        int i = 0;
        while(i < ch.length){
            int  j = i;
            while(j < ch.length && ch[j] != ' '){
                j++;
            }
            if (j< ch.length){
                reverse(ch,i, j-1);
                i = j+1;
            } else {
                reverse(ch,i,j-1);
                i = j;
            }
        }

        String str = new String(ch);
        System.out.println(str);
    }
}
